<!DOCTYPE html>
<html>

	<head><link rel="shortcut icon" href="http://likexia.gitee.io/tools/lib/img/h5.png" type="image/x-icon">
		<meta charset="utf-8">
		<!--自动刷新，1s=1-->
		<!--<META http-equiv="Refresh" content="3">-->
		<!--<meta http-equiv="X-UA-Compatible" content="IE=7" />-->
		<meta http-equiv="X-UA-Compatible" cotent="IE=edge,chrome=1" />
		<!--禁止缓存-测试时用-->
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<!--禁止缓存-测试时用-->
		<!--禁止禁止识别电话号码和邮件-->
		<meta name="format-detection" content="telephone=no, email=no" />
		<!--禁止禁止识别电话号码和邮件-->
		<!--x5内核浏览器包括：QQ浏览器，qq,微信内置的浏览器（ 竖屏显示、以及全屏显示）-->
		<meta name="x5-orientation" content="portrait" />
		<meta name="x5-fullscreen" content="true" />
		<!--x5内核浏览器包括：QQ浏览器，qq,微信内置的浏览器（ 竖屏显示、以及全屏显示）-->
		<!--UC浏览器竖屏显示和全屏显示-->
		<meta name="screen-orientation" content="portrait">
		<meta name="full-screen" content="yes">
		<!--UC浏览器竖屏显示和全屏显示-->
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<link rel="shortcut icon" href="http://likexia.gitee.io/tools/lib/img/h5.png" type="image/x-icon">
		<title>点赞动画</title>
		<style type="text/css">
 body {
            -webkit-user-select: none;
        }

        .wrapper {
            width: 20px;
            margin: 120px auto;
            cursor: pointer;
            color: grey;
            font-size: 30px;
            position: relative;
        }

        .wrapper.active:before {
            content: "❤";
            color: red;
            transform: scale(2);
            display: block;
            position: absolute;
            left: 0px;
            top: -40px;
            animation: ani 1s forwards linear;
        }

        .wrapper.active {
            color: red;
        }

        @keyframes ani {
            20% {
                transform: scale(2) translateY(-4px) rotate(4deg);
                opacity: 0.8;
            }

            60% {
                transform: scale(2) translateY(-12px) rotate(-8deg);
                opacity: 0.4;
            }

            100% {
                transform: scale(2) translateY(-20px);
                opacity: 0;
            }
        }
		</style>
	</head>

	<body>
<div class="wrapper">
    ❤
</div>
<script>
    var oWrapper = document.querySelector('div');
    oWrapper.onclick = function () {
        this.classList.toggle('active');
    }
</script>
	</body>

</html>